Grant Privilege To Role

This operation grants a privilege to a role at the global, database, or collection level.

POST
/v2/vectordb/roles/grant_privilege_v2
Cluster Endpoint

The base URL for this API is in the following format:

http://localhost:19530

export CLUSTER_ENDPOINT="http://localhost:19530"
Parameters
Authorizationstringheaderrequired

The authentication token should be a pair of colon-joined username and password, like username:password. If you are using a project endpoint, only a valid API key with sufficient permissions applies.

Example Value: Bearer {{TOKEN}}
Request Bodyapplication/json
roleNamestringrequired

The name of the role.

privilegestringrequired

The privilege to grant or revoke.

dbNamestring

The name of the database to which the privilege applies. Use * for all databases.

collectionNamestring

The name of the collection to which the privilege applies. Use * for all collections.

export TOKEN="root:Milvus"
curl --request POST \
--url "${CLUSTER_ENDPOINT}/v2/vectordb/roles/grant_privilege_v2" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Request-Timeout: 5" \
--header "Content-Type: application/json" \
-d '{
"roleName": "my_role",
"privilege": "Insert",
"dbName": "my_database",
"collectionName": "my_collection"
}'
Responses

None

A generic response envelope used by operations that return no substantial payload.

codeinteger

Response code.

dataobject

Payload object of the response envelope. It holds the result content of the operation.

Returns an error message.

codeinteger

Response code.

messagestring

Error message.

Success
{
"code": 0,
"data": {}
}